<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/struct_info.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/inc/js/city.js"></script>
<script src="${staticServer}/inc/js/htmlfilter.js"></script>
<script src="${staticServer}/inc/js/model_resp.js"></script>
<script src="${staticServer}/inc/js/consultants/consultant_client_quest.js?1.4"></script>
<script src="${staticServer}/js/web/consultant_client_state.js?1.2"></script>
<script src="${staticServer}/js/web/consultant_student_func.js?1.0"></script>
<script src="${staticServer}/js/web/consultant_client_first.js?2.1"></script>
<script src="${staticServer}/js/web/consultant_client_check.js?1.1"></script>
<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<style>
#SWFUpload_0{
	margin-top: 70px;
    margin-left: -30px;
}
</style>
<script>


var add_Period = function(){
	var id = $("#id").val();
	var center = $("#center").val();
	var login_name = $("#teacher").val();
	var username = $("#username1").val();
	var post = $("#post").val();
	var sex = $("#sex").val();
	var social_security = $("#social_security").val();
	var induction_time = $("#induction_time").val();
	var departure_time = $("#departure_time").val();
	var type = $("#type").val();	
	var reason= $("#reason").val();
	var paid_in_accordance = $("#paid_in_accordance").val();
	var phone = $("#phone").val();
	var beizhu= $("#beizhu").val();
	var work_clothes= $("#work_clothes").val();
	var email= $("#email").val();
	if(login_name==""){
		infopad.err("请输入离职的人员姓名");
		return;
	}
	
	
	$.post("${contextPath}/recruitment/addQuit.json", {
		    "id":id,
		    "center":center,
		    "login_name":login_name,
		    "sex":sex,
		    "social_security":social_security,
		    "post":post,
		    "phone":phone,
		    "paid_in_accordance":paid_in_accordance,
		    "induction_time":induction_time,
		    "departure_time":departure_time,
		    "reason":reason,
			"work_clothes":work_clothes,
			"type":type,
			"email":email,
			"username":username,
			"beizhu":beizhu
		}, function(ms) {
		   var msg = ms.msg;
		   if(msg!=null && msg=="1"){
			   infopad.msg("操作成功！");
			   window.location.href="${contextPath}/recruitment/quit_list.htm";
		   }
			
	});
}
$(function(){
	$("#sy_user").keyup(function(){
		var nickname = $("#sy_user").val();
		$("#b").prop( "checked", false );
		$("#c").prop( "checked", false );
		$("#d").prop( "checked", false );
		$("#e").prop( "checked", false );
		$("#f").prop( "checked", false );
		$("#j").prop( "checked", false );
		$("#h").prop( "checked", false );
		$("#i").prop( "checked", false );
		$("#j").prop( "checked", false );
		$("#k").prop( "checked", false );
		
		$.post("${contextPath}/index/getUserByNickname1.json", {
			"nickname" : nickname
		}, function(ms) {
			 if(ms.user!=null){
			 	var userna = ms.user.username;
				$("#teacher").val(ms.user.nickname);
			 }
			
		});
	});
});



$(function(){
	$("#center").change(function(){
		var center = $("#center").val();
	    $.post("${contextPath}/recruitment/getTeacherByCenter.json", {
	    	"center" : center
		}, function(ms) {
	    	var list = ms.ulist;
	    	var objHtml="";
	    	$("#student").val("");
	    	for(var i=0;i<list.length;i++){
	    		objHtml +='<option value="'+list[i].nickname+'">'+list[i].nickname+'</option>';
	    	}
	    	$("#teacher").html(objHtml);
	    });

	})
});



</script>
</head>
<input type="hidden" id="id" value="<#if quit??>${quit.id}</#if>">
<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>组织架构</li>
			<li>&gt;</li>
			<li class="current">title</li>
		</ul>
	</div>

	<div id="container">
		<div id="title">添加离职反馈情况</div>
		<table id="infotable">
			<tr>
			  <th>中心:</th>
				<td>
					<select id="center" >
					<option value="<#if quit??>${quit.center}</#if>"><#if quit??>${quit.center}</#if></option>
	            		<#if office_List??>
	              			<#list office_List as ls>
	              				<option value="${ls.name}">${ls.name}</option>
	              			</#list>
	            		</#if>
	            	</select>	
				</td>
	            <th>入职日期:</th>
				<td>
					<input type="text" id="induction_time" value="<#if quit??>${quit.induction_time}</#if>" rel="DATE::Y-m-d" value="" size="14" maxlength="15" readonly="readonly" class="DatePicker_Icon">
				</td>
				<th>工资发放:</th>
	            <td>
					<select id="paid_in_accordance" >
	            		<option value="">请选择</option>
						<option value="1">基本工资</option>
						<option value="2">基本工资+岗位工资</option>
	            	</select>	
				</td>
			</tr>
		    <tr>
		    	<th>姓名:</th>
				<td>
				<select id="teacher" >
				<option value="">请选择老师</option>
	            </select>	
	            <input id="sy_user" type="text" value="" placeholder="快速搜索" />
				</td>
				<th>离职日期:</th>
				<td>
					<input type="text" id="departure_time" value="<#if quit??>${quit.departure_time}</#if>" rel="DATE::Y-m-d" value="" size="14" maxlength="15" readonly="readonly" class="DatePicker_Icon">
				</td>
				 <th>离职类型:</th>
	            <td>
					<select id="type">
	            		<option value="">请选择</option>
						<option value="1">试用期主动提出离职</option>
						<option value="2">合同期主动辞职</option>
						<option value="3">劳动合同到期公司不续签</option>
						<option value="4">老师合同期到期员工不续签</option>
						<option value="5">协商解除合同</option>
	            	</select>	
				</td>
				 
			</tr>
			<tr> 
			   <th>性别:</th>
				<td>
					<select id="sex" >
	            		<option value="">请选择</option>
						<option value="0">女</option>
						<option value="1">男</option>
	            	</select>	
				</td>
			  
				<th>联系电话</th>
				<td><input id="phone" type="text" value="<#if quit??>${quit.phone}</#if>" size="20" maxlength="30" /></td>
				<th>是否退社保:</th>
	            <td>
					<select id="social_security" >
	            		<option value="">请选择</option>
						<option value="1">不需要</option>
						<option value="2">需要</option>
	            	</select>	
				</td>
				
				
			</tr>
		
	         <tr>
	            <th>岗位:</th>
				<td><input id="post" type="text" value="<#if quit??>${quit.post}</#if>" size="20" maxlength="30" /></td>
				
				<th>离职原因</th>
				<td><input id="reason" type="text" value="<#if quit??>${quit.reason}</#if>" size="20" maxlength="30" /></td>
				<th>是否有工作服:</th>
	            <td>
					<select id="work_clothes">
	            		<option value="">请选择</option>
						<option value="1">是(在备注里面说明)</option>
						<option value="2">否</option>
	            	</select>	
				</td>
				
			</tr>
			<tr>
			<th>备注:</th>
				
				<td>
				    <textarea name="beizhu" id="beizhu" rows="5" cols="30" value="<#if quit??>${quit.beizhu}</#if>"><#if quit??>${quit.beizhu}</#if></textarea>
				</td>
				<th>离职人员:</th>
				
				<td>
				    <textarea name="username1" id="username1" rows="5" cols="30" value=""></textarea>
				</td>
				<th>个人邮箱:</th>
				
				<td>
				    <textarea name="email" id="email" rows="5" cols="30" value="<#if quit??>${quit.email}</#if>"><#if quit??>${quit.email}</#if></textarea>
				</td>
			</tr>
			
			 
		</table>
		
		<div id="controlbar">
			<input type="button" class="submit" onclick="add_Period()" value="  保  存  " />
		</div>
	</div>
	
</body>
</html>